package com.sxu.greedy.day4;

/**
 * 坏了的计算器
 */
public class Test20 {
    public int brokenCalc(int startValue, int target) {
        int ret = 0;
        while(target > startValue) {
            if(target % 2 == 0)
                target = target / 2;
            else
                target += 1;
            ret++;
        }
        return ret + startValue - target;
    }
}
